const mongoose = require("../config/db");
const moment = require('moment')
const OrganizationSchema = mongoose.Schema({
  org_num: {
    type: String,
  },
  org_name: {
    type: String,
    required: true,
  },
  org_president: {
    type: String,
    required: true
  },
  org_state: {
    type: Number,
    default: 1,
    required: true
  },
  setup_time: {
    type: Date,
    default: moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
  }
}, {
  versionKey: false
})
const OrganizationModel = mongoose.model("Organizations", OrganizationSchema, "organizations");
// OrganizationModel.create({
//   "org_num": 23,
//   "org_name": "交谊舞社",
//   "org_president": "小小",
//   "org_state": 1,
//   "setup_time": new Date()
// });
module.exports = OrganizationModel;